
package pyrachnid.model.scenar_model;

import java.util.ArrayList;

public class Statistics {
	
	private double _averageRobotEfficiency;
	private ArrayList<Graphic> _graphic;
	private double _totalExtinguishingDuration;
	private double _proportionMapBurned;
	private double _totalDistance;
	
	public Statistics() {
	}
	
	public void drawStats() {
		// begin-user-code
		// TODO Module de remplacement de m�thode auto-g�n�r�
		// voir quel module de stat utiliser
		// end-user-code
	}

	public double getAverageRobotEfficiency() {
		return _averageRobotEfficiency;
	}
	public void setAverageRobotEfficiency(double averageRobotEfficiency) {
		this._averageRobotEfficiency = averageRobotEfficiency;
	}
	public ArrayList<Graphic> getGraphic() {
		return _graphic;
	}
	public void setGraphic(ArrayList<Graphic> graphic) {
		this._graphic = graphic;
	}
	public double getTotalExtinguishingDuration() {
		return _totalExtinguishingDuration;
	}
	public void setTotalExtinguishingDuration(double totalExtinguishingDuration) {
		_totalExtinguishingDuration = totalExtinguishingDuration;
	}
	public double getProportionMapBurned() {
		return _proportionMapBurned;
	}
	public void setProportionMapBurned(double proportionMapBurned) {
		this._proportionMapBurned = proportionMapBurned;
	}
	public double getTotalDistance() {
		return _totalDistance;
	}
	public void setTotalDistance(double totalDistance) {
		this._totalDistance = totalDistance;
	}
	
	public String getTotalTime(long firstHour, long finalHour)
	{
		long resultSec = 0;
		long resultMin = 0;
		long resultHour = 0;
		long totalTime = 0;
		totalTime = (finalHour - firstHour) / 1000;
		resultSec = totalTime;
		while (resultSec > 59)
		{
			resultSec -= 60;
			resultMin += 1;
		}
		while (resultMin > 59)
		{
			resultMin -= 60;
			resultHour += 1;
		}
		//****************** Version avec les dates ************************
		//String strDebDiv[] = firstHour.split(":");
		//String strFinDiv[]= finalHour.split(":");
		
		//resultSec = Integer.parseInt(strFinDiv[2]) - Integer.parseInt(strDebDiv[2]);
		
		//if (resultSec < 0)
		//{
			//resultSec += 60;
			//resultMin -= 1;
		//}
		//resultMin += Integer.parseInt(strFinDiv[1]) - Integer.parseInt(strDebDiv[1]);
		//if (resultMin < 0)
		//{
			//resultMin += 60;
			//resultHour -= 1;
		//}
		//resultHour += Integer.parseInt(strFinDiv[0]) - Integer.parseInt(strDebDiv[0]);
		
		return resultHour + ":" + resultMin + ":" + resultSec;
	}
	
	


}